package com.google.ads.util;

import android.content.Context;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import com.google.ads.aq;
import com.google.ads.ar;
import com.google.ads.as;
import com.google.ads.b.j;
import com.google.ads.b.r;
import com.google.ads.b.y;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;

public class w extends y
{
  public w(r paramr, Map paramMap, boolean paramBoolean1, boolean paramBoolean2)
  {
    super(paramr, paramMap, paramBoolean1, paramBoolean2);
  }

  private static WebResourceResponse a(String paramString, Context paramContext)
  {
    HttpURLConnection localHttpURLConnection = (HttpURLConnection)new URL(paramString).openConnection();
    try
    {
      AdUtil.a(localHttpURLConnection, paramContext.getApplicationContext());
      localHttpURLConnection.connect();
      WebResourceResponse localWebResourceResponse = new WebResourceResponse("application/javascript", "UTF-8", new ByteArrayInputStream(AdUtil.a(new InputStreamReader(localHttpURLConnection.getInputStream())).getBytes("UTF-8")));
      return localWebResourceResponse;
    }
    finally
    {
      localHttpURLConnection.disconnect();
    }
  }

  public WebResourceResponse shouldInterceptRequest(WebView paramWebView, String paramString)
  {
    try
    {
      if ("mraid.js".equalsIgnoreCase(new File(paramString).getName()))
      {
        j localj = this.a.i();
        if (localj != null)
          localj.b(true);
        while (true)
        {
          localar = (ar)((aq)this.a.g().a.a()).a.a();
          if (this.a.g().b())
            break label215;
          if (!this.b)
            break;
          String str3 = (String)localar.d.a();
          d.a("shouldInterceptRequest(" + str3 + ")");
          return a(str3, paramWebView.getContext());
          this.a.a(true);
        }
      }
    }
    catch (IOException localIOException)
    {
      ar localar;
      d.d("IOException fetching MRAID JS.", localIOException);
      return super.shouldInterceptRequest(paramWebView, paramString);
      String str2 = (String)localar.c.a();
      d.a("shouldInterceptRequest(" + str2 + ")");
      return a(str2, paramWebView.getContext());
      String str1 = (String)localar.e.a();
      d.a("shouldInterceptRequest(" + str1 + ")");
      WebResourceResponse localWebResourceResponse = a(str1, paramWebView.getContext());
      return localWebResourceResponse;
    }
    catch (Throwable localThrowable)
    {
      while (true)
        label215: d.b("An unknown error occurred fetching MRAID JS.", localThrowable);
    }
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     com.google.ads.util.w
 * JD-Core Version:    0.6.2
 */